/*
Climbing Stairs
You are climbing a stair case. It takes n steps to reach to the top.

Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?*/

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <fstream>
#include <sstream>
#include "print.h"
using namespace std;

/**
* Definition for binary tree*/


void testForStack()
{
	stack<int> mystack;
	mystack.push(10);
	mystack.push(20);
	mystack.top() -= 5;
	cout << "mystack.top() is now " << mystack.top() << endl;
}

void testForIntToString()
{
	int a = 10;
	stringstream ss;
	ss << a;
	string str = ss.str();
	cout << str << endl;

	string str1 = to_string(a);

}





class Solution {
public:
	int climbStairs(int n) {

		vector<int> result(n);

		if (n <=  2)
		{
			return n;
		}
		else
		{
			result[0] = 1;
			result[1] = 2;
			for (int i = 2; i < n; i++)
			{
				result[i] = result[i - 1] + result[i - 2];
			}
			return result[n - 1];
		}

	}
};

int main(int argc, char* argv[])
{


	int a = 0;
	for (int i = 1; i < argc; i++){


		cout << argv[i] << endl;
		a = atoi(argv[i]);
	}

	


	

	Solution s;
	//stackTree.push(p->left);
	//stackTree.push(p->right);
	cout << s.climbStairs(a)<< endl;

	system("pause");
	return 0;
}